
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.ACPCfg;
import Apusic.AJPCfg;
import Apusic.AdvanceServiceManager;
import Apusic.ApusicPackage;
import Apusic.EJBCfg;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Advance Service Manager</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.AdvanceServiceManagerImpl#getAcpCfg <em>Acp Cfg</em>}</li>
 *   <li>{@link Apusic.impl.AdvanceServiceManagerImpl#getEjbCfg <em>Ejb Cfg</em>}</li>
 *   <li>{@link Apusic.impl.AdvanceServiceManagerImpl#getAjpCfg <em>Ajp Cfg</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AdvanceServiceManagerImpl extends WrappingEObjectImpl implements AdvanceServiceManager
{
  /**
   * The cached value of the '{@link #getAcpCfg() <em>Acp Cfg</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAcpCfg()
   * @generated
   * @ordered
   */
  protected ACPCfg acpCfg;

  /**
   * The cached value of the '{@link #getEjbCfg() <em>Ejb Cfg</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEjbCfg()
   * @generated
   * @ordered
   */
  protected EJBCfg ejbCfg;

  /**
   * The cached value of the '{@link #getAjpCfg() <em>Ajp Cfg</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAjpCfg()
   * @generated
   * @ordered
   */
  protected AJPCfg ajpCfg;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected AdvanceServiceManagerImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.ADVANCE_SERVICE_MANAGER;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    result=true;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    AdvacneServiceMgr core=(AdvacneServiceMgr)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ACPCfg getAcpCfg()
  {
    if (acpCfg != null && acpCfg.eIsProxy())
    {
      InternalEObject oldAcpCfg = (InternalEObject)acpCfg;
      acpCfg = (ACPCfg)eResolveProxy(oldAcpCfg);
      if (acpCfg != oldAcpCfg)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.ADVANCE_SERVICE_MANAGER__ACP_CFG, oldAcpCfg, acpCfg));
      }
    }
        Object result=null;
        AdvacneServiceMgr core=(AdvacneServiceMgr)getCore();
        if(core==null) return acpCfg;	
        try
{
    result = core.fetchACPConfig();
     ACPCfgImpl acp=new ACPCfgImpl();
     acp.setCore(result);
     result=acp;
     
}
catch(Exception e)
{
  result = null;
}
        acpCfg=(result instanceof EObject)?(ACPCfg)result:(ACPCfg)ImagePool.find(result);
        	
    return acpCfg; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ACPCfg basicGetAcpCfg()
  {
    return acpCfg;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAcpCfg(ACPCfg newAcpCfg)
  {
    ACPCfg oldAcpCfg = acpCfg;
    acpCfg = newAcpCfg;
        	
      AdvacneServiceMgr core=(AdvacneServiceMgr)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.ADVANCE_SERVICE_MANAGER__ACP_CFG, oldAcpCfg, acpCfg));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EJBCfg getEjbCfg()
  {
    if (ejbCfg != null && ejbCfg.eIsProxy())
    {
      InternalEObject oldEjbCfg = (InternalEObject)ejbCfg;
      ejbCfg = (EJBCfg)eResolveProxy(oldEjbCfg);
      if (ejbCfg != oldEjbCfg)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.ADVANCE_SERVICE_MANAGER__EJB_CFG, oldEjbCfg, ejbCfg));
      }
    }
        Object result=null;
        AdvacneServiceMgr core=(AdvacneServiceMgr)getCore();
        if(core==null) return ejbCfg;	
        try
{
    result = core.fetchEJBConfig();
     EJBCfgImpl ejb=new EJBCfgImpl();
     ejb.setCore(result);
     result=ejb;
     
}
catch(Exception e)
{
  result = null;
}
        ejbCfg=(result instanceof EObject)?(EJBCfg)result:(EJBCfg)ImagePool.find(result);
        	
    return ejbCfg; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EJBCfg basicGetEjbCfg()
  {
    return ejbCfg;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEjbCfg(EJBCfg newEjbCfg)
  {
    EJBCfg oldEjbCfg = ejbCfg;
    ejbCfg = newEjbCfg;
        	
      AdvacneServiceMgr core=(AdvacneServiceMgr)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.ADVANCE_SERVICE_MANAGER__EJB_CFG, oldEjbCfg, ejbCfg));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AJPCfg getAjpCfg()
  {
    if (ajpCfg != null && ajpCfg.eIsProxy())
    {
      InternalEObject oldAjpCfg = (InternalEObject)ajpCfg;
      ajpCfg = (AJPCfg)eResolveProxy(oldAjpCfg);
      if (ajpCfg != oldAjpCfg)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ApusicPackage.ADVANCE_SERVICE_MANAGER__AJP_CFG, oldAjpCfg, ajpCfg));
      }
    }
        Object result=null;
        AdvacneServiceMgr core=(AdvacneServiceMgr)getCore();
        if(core==null) return ajpCfg;	
        try
{
    result = core.fetchAJPConfig();
     AJPCfgImpl ajp=new AJPCfgImpl();
     ajp.setCore(result);
     result=ajp;
     
}
catch(Exception e)
{
  result = null;
}
        ajpCfg=(result instanceof EObject)?(AJPCfg)result:(AJPCfg)ImagePool.find(result);
        	
    return ajpCfg; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AJPCfg basicGetAjpCfg()
  {
    return ajpCfg;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAjpCfg(AJPCfg newAjpCfg)
  {
    AJPCfg oldAjpCfg = ajpCfg;
    ajpCfg = newAjpCfg;
        	
      AdvacneServiceMgr core=(AdvacneServiceMgr)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.ADVANCE_SERVICE_MANAGER__AJP_CFG, oldAjpCfg, ajpCfg));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__ACP_CFG:
        if (resolve) return getAcpCfg();
        return basicGetAcpCfg();
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__EJB_CFG:
        if (resolve) return getEjbCfg();
        return basicGetEjbCfg();
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__AJP_CFG:
        if (resolve) return getAjpCfg();
        return basicGetAjpCfg();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__ACP_CFG:
        setAcpCfg((ACPCfg)newValue);
        return;
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__EJB_CFG:
        setEjbCfg((EJBCfg)newValue);
        return;
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__AJP_CFG:
        setAjpCfg((AJPCfg)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__ACP_CFG:
        setAcpCfg((ACPCfg)null);
        return;
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__EJB_CFG:
        setEjbCfg((EJBCfg)null);
        return;
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__AJP_CFG:
        setAjpCfg((AJPCfg)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__ACP_CFG:
        return acpCfg != null;
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__EJB_CFG:
        return ejbCfg != null;
      case ApusicPackage.ADVANCE_SERVICE_MANAGER__AJP_CFG:
        return ajpCfg != null;
    }
    return super.eIsSet(featureID);
  }

} //AdvanceServiceManagerImpl
